/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package intermediario;

/**
 *
 * @author afonso.rodrigues
 */
public class Contador2 {

    private int value;

    public Contador2() {
        value = 0;
    }

    public synchronized void incrementa() {
        value++;
        System.out.println(Thread.currentThread().getName()+" incrementado!");
    }
    public synchronized int getValue(){
    return value;
    }
}
